#include "CApp.h"
#include <conio.h>
#include <libconfig.hh>
using namespace libconfig;

#include "ImageManager.h"

CApp::CApp(const std::string& windowTitle)
{
	m_windowTitle = windowTitle;
}

CApp::~CApp()
{

}

int CApp::OnExecute()
{
	if(OnInit() == false)
		return -1;
    
    while(m_Window.IsOpened())
	{
		sf::Event Event;
		while(m_Window.PollEvent(Event))
		{
			OnEvent(Event);
		}		

        OnLoop();

		//m_Window.SetActive();
		m_Window.Clear();
        OnRender();
		m_Window.Display();
    }

    OnShutdown();

    return 0;
}

// Entry Point
int main( int argc, char* argv[] )
{
	CApp App("Now with 100% more SFML");

	return App.OnExecute();
}